package com.mobimap.nhom9.gui;

//import com.mobimap.nhom9.gui.DataInfo.MapHandle;
//import com.mobimap.nhom9.gui.DataInfo.Point;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.MenuItem;
import android.view.Menu;
//import android.graphics.Bitmap;
//import android.graphics.BitmapFactory;
//import android.widget.FrameLayout.LayoutParams;
//import android.widget.ImageView;
//import android.widget.RelativeLayout;
//import android.widget.RemoteViews;
//import android.widget.RemoteViews.RemoteView;


public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        drawImage("a_15_26090_15388", new Point(0,100), 5);
        
        //TestMapHandle();
    }

//    public void drawImage(String fileName, Point pos, float scale){
//    	
//    	ImageView iv = new ImageView(this);    	
//    	int id = getResources().getIdentifier(fileName , "drawable", getPackageName());
//    	Bitmap bm = BitmapFactory.decodeResource(getResources(), id);
//    	iv.setImageBitmap(bm);
//    	
//    	RelativeLayout rl = (RelativeLayout)findViewById(R.id.my_relative_layout);
//    	RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(bm.getWidth(), bm.getHeight());
//    	param.leftMargin = (int)pos.getLogitude();
//    	param.topMargin = (int)pos.getLatitude();
//    	rl.addView(iv, param);
//    	
//    	/*LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
//    	params.setMargins(100,0, 0,0);
//    	iv.setLayoutParams(params);*/
//    	
//
//    	
//    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
//    
//    private void TestMapHandle(){
//    	
//    	Point hinh = new Point(10.779329, 106.692438);
//    	Point tempPoint = MapHandle.ToPoint(hinh, 15);
//    	double kkk = tempPoint.getLatitude();
//    	kkk = kkk + 1;
//    
//    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	switch(item.getItemId())
    	{
    		case R.id.menu_home:
    			Intent it_home = new Intent(getApplicationContext(),MainActivity.class);
    			startActivity(it_home);
    			return true;
    		case R.id.menu_timDiaChi:
    			Intent it_timDiaChi = new Intent(getApplicationContext(),Tim_Dia_Chi.class);
    			startActivity(it_timDiaChi);
    			return true;
    		case R.id.menu_timDichVu:
    			Intent it_timDichVu = new Intent(getApplicationContext(),Tim_Dich_Vu.class);
    			startActivity(it_timDichVu);
    			return true;
    		case R.id.menu_timDuong:
    			Intent it_timDuong = new Intent(getApplicationContext(),Tim_Duong.class);
    			startActivity(it_timDuong);
    			return true;
    		case R.id.menu_Exit:
    			finish();
    			return true;
			default:
				return super.onOptionsItemSelected(item);
    	}
    	
    }
}
